<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        // let person = { name: 'zhangsan', age: 20 };
        // let { name, age } = person;
        // console.log(name); // 'zhangsan' 
        // console.log(age); // 20

        // let person = { name: 'zhangsan', age: 20 };
        // let { name:myname, age:myage } = person;
        // console.log(myname); // 'zhangsan' 
        // console.log(myage); // 20



        
        // let person = { name: 'zhangsan', age: 20 ,hobby:['篮球','足球','地球']};
        // let { name:name, age:age,hobby:hobby } = person;
        // console.log(name); // 'zhangsan' 
        // console.log(age); // 20
        // console.log(hobby); // ['篮球','足球','地球']






        //   es6 当中  对象  如果key 跟val 相同  可以只写一个
          // 左右两边 结构一致  右边要是一个不出错的代码
        // let person = { name: 'zhangsan', age: 20 ,hobby:['篮球','足球','地球']};
        // let { name:name, age,hobby } = person;
        // console.log(name); // 'zhangsan' 
        // console.log(age); // 20
        // console.log(hobby); // ['篮球','足球','地球']







    

    </script>
</body>

</html>